// FLVVideoParser.h: interface for the CFLVVideoParser class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_FLVVIDEOPARSER_H__F7F6B6AD_5CC0_449D_A049_F7CECB337D66__INCLUDED_)
#define AFX_FLVVIDEOPARSER_H__F7F6B6AD_5CC0_449D_A049_F7CECB337D66__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "FLVDefine.h"

class CFLVVideoParser  
{
public:
	CFLVVideoParser();
	virtual ~CFLVVideoParser();

public:
	void SetCallback(FLVParserCallBackFunc* pCallback, LPVOID lpParam = NULL);
	bool Parse(uint32_t PTS, uint8_t* pData, int nLen);

	static void avc_nal_encode(uint8_t* pIn, int nInLen, uint8_t* pOut, int& nOutLen, bool isnal);

private:
	void Output(uint32_t PTS, uint8_t* pData, int nLen, bool isnal);

	bool Parse_head(uint32_t PTS, uint8_t* pData, int nLen);
	bool Parse_data(uint32_t PTS, uint8_t* pData, int nLen);

private:
	FLVParserCallBackFunc*	m_pCallback;
	LPVOID	m_lpParam;
	bool	m_bHeadParsed;
};

#endif // !defined(AFX_FLVVIDEOPARSER_H__F7F6B6AD_5CC0_449D_A049_F7CECB337D66__INCLUDED_)
